package com.sc.javaee.controller;

import com.sc.javaee.pojo.Result;
import com.sc.javaee.pojo.Review;
import com.sc.javaee.service.ReviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ReviewController {
    @Autowired
    ReviewService rs;
    @RequestMapping("/getReviewsByProductId")
    public Result getReviewsByProductId(Integer pid){
        List<Review> reviews=rs.getReviewsByProductId(pid);
        return new Result(1, "查询成功", reviews);
    }
}
